<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>'a.jsp'</title>
<style type="text/css">
td {
	text-align: center;
}
</style>
</head>

<body bgcolor="#99ffcc">
	<h2 align="center">账号状态管理</h2>
	<form action="${pageContext.request.contextPath }/SearchForUser"
		method="post">
		<table align="center">
			<tr>
				<td><select name="sort">
						<option value="account">按账号搜索</option>
						<option value="nick">按昵称搜索</option>
				</select>
				</td>
				<td><input type="text" value="${searchname}" name="searchname"
					style=background-color:#99ffc0></td>
				<td><input type="submit" value="搜索">
				</td>

				<!-- 按了搜索后的提示 -->
			<tr>
				<c:choose>
					<c:when test="${Userfound !=null}">
						<td>${searchname }，已找到<br /></td>
					</c:when>
					<c:otherwise>
						<c:if test="${not empty searchname }">
							<td>${searchname }没有找到</td>
						</c:if>
					</c:otherwise>
				</c:choose>
			</tr>

		</table>
		<input type="hidden" name="what_submit" value="admin_search">
	</form>

     <h4 align="center">${msg }</h4>
	<!-- 找到后显示和操作提示 -->
	<c:if test="${Userfound !=null}">
		<form action="${pageContext.request.contextPath }/SearchForUser"
			method="post">
			<table align="center">
				<tr>
					<td>账号</td>
					<td>昵称</td>
					<td>状态</td>
				</tr>

				<tr>
					<td>${Userfound.username }</td>
					<td>${Userfound.nickname }</td>
					<c:if test="${Userfound.status eq '0' }">
						<td>读者</td>
					</c:if>
					<c:if test="${Userfound.status eq '1' }">
						<td>作者</td>
					</c:if>
					<c:if test="${Userfound.status eq '2' }">
						<td>管理员</td>
					</c:if>
				</tr>
				<tr>
					<td>更改为</td>
					<td><input type="radio" name="status" value="0" checked/> 读者
					<input type="radio" name="status" value="1" /> 作者</td>
					<td><input type="submit" value="提交更改" /></td>
				</tr>
			</table>
			<input type="hidden" name="what_submit" value="user_change_status">
			<input type="hidden" name="may_change_user" value="${Userfound.username }">
			<input type="hidden" name="oldStatus" value="${Userfound.status }">
		</form>
	</c:if>
</body>
</html>
